package view;

import java.awt.Graphics;
import java.awt.Image;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

public class Img extends JPanel { 
    public void paintComponent(Graphics g){
        try {
        		URL urlImg = this.getClass().getResource("/paris.JPG");
        		System.out.println(urlImg);
                Image img = ImageIO.read(new File(urlImg.toURI()));
                g.drawImage(img, 200, 200, 200, 200, this);
                //Pour une image de fond
                //g.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), this);
       	} catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
        } catch (URISyntaxException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}   
    }               
}
